home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / MATH / EJCPLX01 / READ.ME < prev    next >
Text File  |  1989-07-21  |  3KB  |  91 lines

  1. Here are four files that comprise a unit for Turbo
  2. Pascal 5.5, COMPLEX.  COMPLEX is a preliminary
  3. implementation of the complex numbers as a TP 5.5
  4. Object.  I have included support for the Streams
  5. of the OBJECTS unit provided with TP 5.5.
  6.  
  7. One of the file is TRIG.PAS, the source code for a unit
  8. TRIG.TPU designed to implement the trigonometric functions
  9. that Turbo Pascal 5.5 does not include and the hyperbolic
  10. functions.  It is provided on the Turbo Professional 5.0
  11. BONUS diskette and is in the public domain.  The others are
  12. TRIG.TPU, its compiled form, COMPLEX.PAS, my source code,
  13. and COMPLEX.TPU, its compiled form.
  14.  
  15. Some of the algorithms are quite naive; I do intend to
  16. improve them in the near future.  I will also extend this
  17. package to the "extended" complex numbers; that is, the
  18. Riemann sphere.  For those of you who are not familiar with
  19. the Riemann sphere, this can be simply explained as adding a
  20. "point at infinity" to the complex numbers.  In the future,
  21. I will add units for the quaternions, and for various
  22. classes of functions and curves over the complex numbers.
  23.  
  24. This package is copyright 1989 by Eric Robert Jablow.
  25. However, you may modify it and use it in any non-profit
  26. project you wish provided that you provide credit to me.
  27.  
  28. Please note that I have used two routines from the Turbo
  29. Professional 5.0 package by TurboPower Software.  Should you
  30. wish to recompile this unit, and should you not own that
  31. fine project, you will need to modify the ReportError method
  32. so that it does not use the OpenStdDev and HexPtr routines
  33. from Turbo Professional 5.0 (and the StdErrHandle constant).
  34. I used them to ensure that error messages would be sent to
  35. DOS's standard error device and to print the address of any
  36. ComplexNumber object that caused an error.
  37.  
  38. I have been extremely verbose in the COMPLEX.PAS unit;
  39. unfortunately, that is the only documentation I have as yet.
  40. I think that I could have used names like `Cos' or `Read'
  41. for my methods instead of `ComplexCos' or `ReadNum'.
  42. However, I decided not do anything that confusing for now.
  43.  
  44. Please send me comments, questions, bug reports, and
  45. suggestions for later versions of this.
  46.  
  47. Here is a sample program to compute and print the 5 complex
  48. fifth roots of 2.0 + 3.0i.
  49.  
  50. Program ComplexSample;
  51.  
  52. Uses Complex;
  53.  
  54. var
  55.   j    : Integer;
  56.   z    : ComplexNumber;
  57.   root : ComplexNumber;
  58.  
  59. begin
  60.   z.Init(2.0, 3.0);     { Set z equal to 2.0 + 3.0i. }
  61.   root.RealInit(1.0);   { Set root equal to 1.0+0.0i }
  62.                         { for now.                    }
  63.                         { Both Init and RealInit are  }
  64.                         { valid constructors.         }
  65.   For j := 0 To 4 Do
  66.     Begin
  67.       root := z;        { Now root equals 2.0 + 3.0i.}
  68.  
  69.       root.BrRealPower( 0.2, 2 * j * Pi);
  70.  
  71.                         { Take the fifth root, using  }
  72.                         { the correct branch of the   }
  73.                         { complex logarithm.          }
  74.  
  75.       root.Display;     { Write root to the screen.   }
  76.       WriteLn           { Go to next line.            }
  77.     End
  78. end; { SampleComplex }
  79.  
  80. This is not the most efficient manner of doing this, and I
  81. didn't present all of the methods, but I think you can get
  82. the flavor of what I've done.
  83.  
  84. P.S.  Because this was so preliminary, I compiled it with
  85. range checking on and with support for the standalone Turbo
  86. Debugger version 1.5.  Bye!
  87.  
  88. Respectfully,
  89. Eric Jablow
  90.  
  91.